<{:W('Bizhome/header',array($biz_item_num,$user))}>
    <div class="right_box">
		<div class="content">
			<div class="head_box">
				<h2>活动列表</h2>
				<form id="myForm" action="__APP__/Home/Activity/changeType" method="post">
				<select name="activity_select" id="activity_select" onchange="formSubmit()">
				   <option value="0" >请选择</option>
				   <option value="1" <range name="user.access" value="1,4,5,7" type="notin" >disabled</range> >球馆公告</option>
				   <option value="2" <range name="user.access" value="3,5,6,7" type="notin" >disabled</range> >教练公告</option>
                   <option value="3" <range name="user.access" value="2,4,6,7" type="notin" >disabled</range> >球会公告</option>
				</select>
				</form>
			</div>
			
			<div class="info_table">
				<table>
					<tbody>
						<tr>
							<th>活动名称</th>
							<th>活动种类</th>
							<th>活动详情</th>
							<th>报名人数</th>
							<th>状态</th>
							<th>功能</th>
						</tr>
					<foreach name="data" item="vo" key="k">
						<!-- <input type="hidden" name="activity_id" value="<{$vo.activity_id}>" /> -->
                        <tr class="alt" id="list">
                         	<td><{$vo.activity_name}></td>
                         	<td class="detail">
                                <in name="vo.activity_if_public" value = "0">不公开</in>
                                <in name="vo.activity_if_public" value = "1">公开</in>
                            </td>                      
                         	<td class="detail">
                         		发起人:<{$vo.activity_organizer_id}><br>
                         		活动报名开始时间:<{$vo.apply_start_time}><br>
                         		活动报名截止时间:<{$vo.apply_end_time}><br>
                         		活动开始时间:<{$vo.activity_start_time}><br>
								活动结束时间:<{$vo.activity_end_time}>
                         	</td>
                         	<td class="detail"><{$vo.apply_number}></td>
                         	<td class="detail">
                         		<in name="vo.activity_status" value = "0">申请</in>
                         		<in name="vo.activity_status" value = "1">报名</in>
                                <in name="vo.activity_status" value = "2">进行</in>
                                <in name="vo.activity_status" value = "3">结束</in>
                         	</td>
                         	<td>
                         		<button onclick="activity_detail(<{$k}>)">详情</button>
								<button onclick="delete_activity(<{$k}>)">删除</button>
                         		<button onclick="edit_activity(<{$k}>)">修改</button>
								<button onclick="get_apply_people(<{$k}>)">报名详情</button>
                         	</td>
                        </tr> 
                    </foreach>					              
					</tbody>
				</table>
				
			</div>	
			
			<div class="blank"></div>		
		</div>
	</div>	


<div class="blank20"></div>
<script type="text/javascript">
var msg;var selected;
  function delete_activity(num)
  { 
    
    layer.confirm('确定删除？', {
    btn: ['确定','取消'] //按钮
    }, function(){  
       selected=num;	
       $.post('__URL__/deleteActivity',{'act_id':num},function(resultList){ 			   
			  msg=resultList.msg;
			  if (msg!=0) {
			    layer.msg('活动已开始，不能删除');
			  }
			  else 
			  {
			    layer.msg('删除成功');
			  }
    	     },'json');  
    }, function(){
      
    });
	 
  }
  function edit_activity(num)
  {
     selected=num;
	 $.post('__URL__/activityDetail',{'act_id':num},function(resultList){ 			   
			  msg=resultList.msg;
			  if (msg!=0) {
			    layer.msg('活动已开始，不能修改');
			  }
			  else 
			  {
			     layer.open({
                 type: 2,
                 title: '修改活动',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['600px' , '420px'],
                 content: 'edit_activity.html'
				 });
			  }
    	     },'json');  
	
    
  }
   function activity_detail(num)
   {
      selected=num;
	  layer.open({
                 type: 2,
                 title: '活动详情',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['600px' , '420px'],
                 content: 'activity_detail.html'
				 });
   }
   
   function get_apply_people(num)
   {
      selected=num;
	  layer.open({
                 type: 2,
                 title: '报名详情',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['600px' , '420px'],
                 content: 'apply_people.html'
				 });
   }
    function formSubmit()
   {
	 document.getElementById("myForm").submit();
   }
</script>
<{:W('Bizhome/footer')}>
